package com.ssy.lingxi.platform.manage.controller.mobile;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.manage.model.request.common.CommonIdRequest;
import com.ssy.lingxi.platform.manage.model.response.AppVersionManagerRes;
import com.ssy.lingxi.platform.manage.model.response.NewVersionRes;
import com.ssy.lingxi.platform.manage.service.IAppVersionManagerService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu APP端 - APP版本管理相关接口
 * @author wyx
 * @version 2.0.0
 * @date 2021-11-12
 */
@RestController
@RequestMapping("/manage/mobile/app/version")
public class AppVersionManagerMobileController {
    @Resource
    private IAppVersionManagerService appVersionManagerService;


    /**
     * APP端-查看最新版本号
     * @return 操作结果
     */
    @RequestMapping(value = "/find/new", method = RequestMethod.GET)
    public Wrapper<NewVersionRes> findNewVersion() {
        return appVersionManagerService.findNewVersion();
    }

    /**
     * APP端-查看版本详情
     * @param req 请求参数
     * @return 操作结果
     */
    @RequestMapping(value = "/find", method = RequestMethod.GET)
    public Wrapper<AppVersionManagerRes> find(@Valid CommonIdRequest req) {
        return appVersionManagerService.find(req);
    }
}
